-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New validation rules and refactoring #23
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This commit updates the GitHub Actions workflows by adding a new "test-phar" job for verifying the functionality of the PHAR binary. The names and actions of existing jobs were updated to be more informative. The README file was also cleaned up for better readability. Changes also included the addition of planned features related to tool versioning.
…re aware of the new output format.
Added distinct Docker run actions for valid and invalid CSV file validation in the GitHub workflows main.yml file. Extended the workflow steps to individually deal with valid and invalid CSV files. Related image and volume parameters have been adjusted accordingly to run the validation tests properly.
Pull Request Test Coverage Report for Build 8273211644Details
💛 - Coveralls |
The commit updates the versions of PHPStan and Roave/SecurityAdvisories in the composer.lock file. Both libraries have been upgraded to newer versions, with the reference and URL addresses correspondingly updated. This ensures that the project is using the most recent
The order of operations in the csv-blueprint.php file was modified to include the JBZOO_AUTOLOAD_FILE at the beginning of the iteration. Previously it was included right before setting the default timezone, potentially causing issues if certain elements needed in the iteration were not loaded properly.
The table rendering in ErrorSuite.php has been refactored to dynamically set column sizes based on terminal width rather than using fixed widths. A new method getTableSize() has been added to calculate and return the sizes. The relevant tests and documentation in README.md, have been adjusted to reflect these changes.
Adjusted the column size handling in ErrorSuite.php to use 'COLUMNS_TEST' instead of 'COLUMNS' for improved testing flexibility. Also applied changes to Makefile and phpunit.xml.dist files to align with the modification made in ErrorSuite.
Reorganized and refactored the architecture of Validators and Rules within the codebase. The Rules were moved under the base namespace rather than under Validators. Additionally, implemented the ColumnValidator and ScvValidator, and refactored the abstract base Validator class into AbstractValidator. Adjustments were also applied to unit tests receiving the impact of these changes, ensuring comprehensive test coverage over the refactored structure.
… maintainability and clarity. The validation code in `CsvFile` has been refactored to a new class, `CsvValidator`, for better encapsulation and readability. The use statements in `CsvFile` and `Column` classes have been updated to reflect these changes. The `AbstractValidator` has been removed for simplicity, hence, `ColumnValidator` and `CsvValidator` classes no longer extend it. Furthermore, a typo in the `CsvValidator` filename was corrected. The commit aims to make the validation process easier to maintain and understand.
Added new rules for minimum and maximum precision in the schema files and created corresponding validation logic in the PHP files. Updated test files to include tests for these new rules. Enhanced the precision functionality in the schema files and reflected these changes in the README for clarity.
Clarified precision rules in both full schema and README file by adding a note about inclusion of zeroes in minimum and maximum precision calculations. This will ensure the users understand this particular aspect when dealing with precision logic.
Introduced new validation rules related to string content and word count. The changes include rules for word counting, string beginning and ending content, and required content presence in strings. These modifications expand the ability of the library to perform more intricate validations, aiding in ensuring data consistency and accuracy in CSV files.
Updated method signatures across codebase to remove nullable string types for validation input. These changes ensure consistency in handling input values from CSV files. The prior handling could potentially lead to null value related errors, thus this update improves the overall stability of the CSV validation process.
A new validation rule is_alias has been added to the schema examples in the full.json, full.php and full.yml files. Due to this addition, a new IsAlias.php file is created under src/Rules, which will validate the aliases present in these files. This function is also tested in Blueprint/RulesTest.php.
Error messages have been added to return statements in the AllMustContain, AtLeastContains, StrEndsWith, and StrStartsWith rules when no value or an empty value is provided in the schema files. This results in more informative feedback. Additionally, corresponding tests have been instituted in the RulesTest.php file to verify the functioning of these updates.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit updates the GitHub Actions workflows by adding a new "test-phar" job for verifying the functionality of the PHAR binary. The names and actions of existing jobs were updated to be more informative. The README file was also cleaned up for better readability. Changes also included the addition of planned features related to tool versioning.